﻿using System.ComponentModel.DataAnnotations;
using CodeSaude.Domain.Interfaces.Repository;
using CodeSaude.Domain.Entities;
using CodeSaude.Domain.Interfaces.Service;

namespace CodeSaude.Domain.Services
{
    public class MenuService : BaseService<Menu>, IMenuService
    {
        private readonly IMenuRepository _menuRepository;

        public MenuService(IMenuRepository menuRepository)
            : base(menuRepository)
        {
            _menuRepository = menuRepository;
        }

        public ValidationResult AdicionarMenu(Menu menu)
        {
            //var resultadoValidacao = Usuario.EstaValidoParaCadastro();

            //if (resultadoValidacao.IsValid)
            base.Add(menu);

            //return resultadoValidacao;
            return null;
        }

        public void SaveChanges()
        {
            _menuRepository.SaveChanges();
        }
    }
}
